import 'package:flutter/material.dart';

/// tag_item_widget.dart
///
/// Created by fuchuanwei on Thu Apr 13 2023.
///
/// Description: 标签Item组件
///

class TagItemWidget extends StatelessWidget {
  final Color? color;
  final double? radius;
  final String label;
  const TagItemWidget(
      {super.key, this.color, this.radius, required this.label});

  @override
  Widget build(BuildContext context) {
    Color bg = (color ?? Theme.of(context).primaryColor).withOpacity(0.05);
    Color border = (color ?? Theme.of(context).primaryColor).withOpacity(0.15);
    return Container(
      padding: EdgeInsets.symmetric(horizontal: 5.0, vertical: 2.0),
      decoration: BoxDecoration(
        color: bg,
        border: Border.all(color: border),
        borderRadius: BorderRadius.circular(radius ?? 3.0),
      ),
      child: Text(
        label,
        style: TextStyle(
          color: color ?? Theme.of(context).primaryColor,
          fontSize: 12.0,
        ),
      ),
    );
  }
}
